#include "Tables.h"

CTables* CTables::m_pInstance = NULL;

CTables* CTables::GetInstance()
{
	if(NULL == m_pInstance)
	{
		m_pInstance = new CTables();
	}
	return m_pInstance;
}
//============================================
CTables::CTables()
{
  p_tab_black = NULL;
}

CTables::~CTables()
{
}

int32_t CTables::init()
{
  p_tab_black = new CTableBlackList();
  p_tab_black->init("blacklist");
  return 0;
}
int32_t CTables::destory()
{
  if(NULL != p_tab_black)
  {
    delete p_tab_black;
    p_tab_black = NULL;
  }
  if (NULL != m_pInstance)
  {
    delete m_pInstance;
    m_pInstance = NULL;
  }
  return 0;
}

int32_t CTables::check_black(const char* phone, const char* check)
{
  return p_tab_black->checkblack(phone, check);
}
